/**
 * Created by zhanglihe on 15/8/12.
 */

require.config(require_config);

define([
    'jquery',
    'common',
    'ready'
], function( $, common, ready ) {
    var index = function() {
        this.init();
    };
    index.prototype = {
        init: function() {
            this.fetch();
        },
        fetch: function() {
            var _this = this;
            //获取当天数据
            $.ajax({
                url: _global.url.api + 'panel/admin',
                type: 'get',
                data: {},
                success: function(res) {
                    _this.render(res.data);
                }
            });
        },

        render: function(data) {
            $('#apply_ysq_num').html(data.apply_ysq_num);
            $('#apply_rz_num').html(data.apply_rz_num);
            $('#apply_pv_num').html(data.apply_pv_num);
            $('#apply_uv_num').html(data.apply_uv_num);
            $('#apply_order_num').html(data.apply_order_num);
            $('#apply_sale_num').html(data.apply_sale_num);
        }
    };

    new index();

});